// hello everyone, this is TD session 5 (WEEK 6)
// Today the exercises are 3.15, 3.13 and 4.4
// your task is to translate the algorithms (in pseudo-language) into C language

#include <stdio.h>

int Ex3_13() {
    int n,i;

    printf("enter a positive integer >1:\n");
    scanf("%d",&n);

    if(n==2)
        printf("2 is a prime number\n");
    else
    {
        if(n%2 ==0)
            printf("this is not a prime\n");
        else
        {
            i = 3;
            while(i*i<n&&n%i!=0)
            {
                i = i+2;
            }
        }
        if(i*i<=n)
            printf("this is not a prime\n");
        else
            printf("this is a prime");
    }

    return 0;
}
